package com.museum.user.dao;

import java.util.ArrayList;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class UserDao extends SqlMapClientDaoSupport
{
	public Logger logger = Logger.getLogger(this.getClass());

	/**
	 * 회원관리 목록
	 */
	public ArrayList<Map<String, Object>> selectUserInfo(Map<String, Object> param) throws DataAccessException
	{
		logger.info("회원관리목록 DAO");
		@SuppressWarnings("unchecked")
		ArrayList<Map<String, Object>> rslist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("User.selectUserInfo", param);
        return rslist;
	}

	/**
	 * 회원관리 상세
	 */
	public Map<String, Object> selectUserInfoById(Map<String, Object> param) throws DataAccessException
	{
		logger.info("회원관리상세 DAO");
		@SuppressWarnings("unchecked")
		Map<String, Object> rs = (Map<String, Object>) getSqlMapClientTemplate().queryForObject("User.selectUserInfoById", param);
        return rs;
	}
	
	/**
	 * 회원관리 등록
	 */
	public void insertUserInfo(Map<String, Object> param) throws DataAccessException
	{
		logger.info("회원관리 등록 DAO");
		getSqlMapClientTemplate().insert("User.insertUserInfo", param);
        return;
	}

	/**
	 * 회원관리 수정
	 */	
	public void updateUserInfo(Map<String, Object> param) throws DataAccessException {
		logger.info("회원관리 수정 DAO");
		getSqlMapClientTemplate().update("User.updateUserInfo", param);
        return;
	}

	/**
	 * 회원관리 삭제
	 */	
	public void deleteUserInfo(Map<String, Object> param) throws DataAccessException {
		logger.info("회원관리 삭제 DAO");
		getSqlMapClientTemplate().update("User.deleteUserInfo", param);
        return;
	}	
	
}
